package com.bit.frige;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.TabHost;

import com.bit.frige.sub.food.SubFoodContensActivity;

public class TabtestActivity extends TabActivity {
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        Intent getintent = getIntent();
		int place = getintent.getIntExtra("place", 0);
        final TabHost tabHost = getTabHost();
        Intent intent = new Intent(getApplicationContext(),SubFoodContensActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		intent.putExtra("place", 1);
		
		Intent intent2 = new Intent(getApplicationContext(),SubFoodContensActivity.class);
		intent2.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		intent2.putExtra("place", 2);
        tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("냉동")
                .setContent(intent
                .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
 
        tabHost.addTab(tabHost.newTabSpec("tab2")
                .setIndicator("냉장")
                .setContent(intent2
                .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
        tabHost.setCurrentTab(place-1);
    }
}